package com.blog.mapper;

import com.blog.entity.User;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserMapper {


    @Select("select account, password from sys_user where account = #{account} and password = #{password}")
    User findByAccountAndPassword(@Param("account") String account, @Param("password") String password);

    /**
     * 增加用户
     * @param user
     */
    void insertUser(User user);


//    int deleteUserById(@Param("id") Long id);


    @Select("select account from sys_user where account = #{account} limit 1 ;")
    User findByAccount(@Param("account") String account);

    @Select("select * from sys_user where account=#{account}")
    User selectByUserAccount(String account);

}
